﻿myApp.controller('PreviewBlogController', function ($scope, previewService, $rootScope) {
    // var vm = this;
    // Read the data
    // vm.listItems = sharedList.getList();

    var obj = JSON.parse(JSON.stringify(previewService.getObject()))[0];
    //alert("OBJ: " + JSON.parse(obj)[0]["metatitle"]);

   // alert("OBJ: " + obj[0].metatitle);
   // alert("OBJ: " + obj.metatitle);

    $scope.$emit('newPageLoaded', {
        'title': obj.metatitle,
        'description': obj.metadescription,
        'keywords': obj.metakeywords
    });

    //alert("PREVIEW DATA: " + JSON.stringify(previewService.getObject()));

    $scope.title = obj.title;
    $scope.html = obj.contents;




   
   
   
});